package com.gjy.minio.service;

import com.gjy.minio.domain.BucketInfo;
import com.gjy.minio.domain.FileInfo;
import com.gjy.minio.domain.FileItem;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-09-04 20:08:56
 */
public interface MinioService {

    boolean existsBucket(String bucket);

    boolean createBucket(String bucket, String type);

    boolean deleteBucket(String bucket);

    boolean deleteBucketForce(String bucket);

    List<BucketInfo> getBuckets();

    FileInfo uploadFile(String bucket, MultipartFile file);

    List<FileInfo> uploadFile(String bucket, List<MultipartFile> files);

    void downloadFile(String bucket, String filename, HttpServletResponse response);

    FileInfo previewFile(String bucket, String filename);

    boolean deleteFile(String bucket, String filename);

    List<FileItem> getFiles(String bucket);

}
